@mixin img-style($layout) {
    width: $layout;
    border-radius: 4px;
    display: block;
    max-width: 800px;
    object-fit: cover;
    @content;
}

.PostDetail {
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 20px 0;
    margin-top: 60px;

    .postDetail-container {
        max-width: 910px;
        margin: 0 auto;
        display: flex;
        gap: 30px;
    }

    .postDetail-actions {
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        position: sticky;
        top: 80px;
        height: fit-content;

        .action-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            padding: 10px;
            border-radius: 8px;
            transition: all 0.3s;
            width: 100%;

            &:hover {
                background-color: #e8f4ff;
            }

            .el-icon {
                font-size: 24px;
                margin-bottom: 5px;
            }

            .action-text {
                font-size: 12px;
                color: #666;
            }

        }
    }

    .postDetail-main {
        flex: 1;
        padding: 24px;

        .postDetail-content {
            width: 100%;
            max-width: 720px;
            position: relative;
            border-radius: 8px;
            padding: 24px;
            background-color: #fff;
            margin-bottom: 20px;

            .post-header {
                margin-bottom: 24px;
                padding-bottom: 16px;
                border-bottom: 1px solid #f0f0f0;

                .post-title {
                    font-size: 28px;
                    font-weight: 600;
                    color: #333;
                    margin-bottom: 12px;
                }

                .post-meta {
                    font-size: 14px;
                    color: #999;
                }
            }

            .post-body {

                :deep(.custom-image-wrapper) {
                    margin: 16px 0;
                    padding: 8px;
                    border-radius: 8px;

                    img {
                        @include img-style(100%) {
                            margin: 0 auto; // 居中显示
                        }
                        &:hover {
                           cursor: pointer; 
                        }
                    }
                }

                .post-text {
                    font-size: 16px;
                    line-height: 1.8;
                    color: #333;
                    margin-bottom: 24px;
                }
            }

            .report-container {
                padding: 10px;
                width: 20px;
                height: 0;
            }

            .report {
                position: absolute;
                right: 0;
                bottom: 0;
                padding: 6px 12px;
                border-radius: 4px;
                color: #666;
                cursor: pointer;
                transition: all 0.3s;

                &:hover {
                    color: #5fc167;
                }
            }
        }

        .comment-body {
            width: 100%;
            background-color: #fff;
            border-radius: 8px;
            padding: 24px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            margin-top: 20px;

            .comment-header {
                padding-bottom: 15px;
                border-bottom: 1px solid #f0f0f0;
                margin-bottom: 20px;

                .header-title {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;

                    .title-left {
                        display: flex;
                        align-items: center;
                        gap: 10px; // 缩小间距

                        .all-comment,
                        .Only-look-up {
                            font-size: 14px;
                            color: #666;
                            cursor: pointer;
                            padding: 4px 12px;
                            border-radius: 4px;
                            transition: all 0.2s;

                            &:hover {
                                background-color: #f5f5f5;
                                color: #333;
                            }
                        }

                        .all-comment {
                            font-weight: 600;
                            color: #333;
                        }
                    }

                    .title-right {
                        display: flex;
                        gap: 10px;

                        .default,
                        .up-to-date {
                            font-size: 14px;
                            color: #666;
                            cursor: pointer;
                            padding: 4px 12px;
                            border-radius: 4px;

                            &:hover {
                                background-color: #f5f5f5;
                            }
                        }
                    }
                }
            }

            .comment-centent {
                margin-top: 20px;
                padding: 16px;
                background-color: #fafafa;
                border-radius: 8px;
                border: 1px solid #f0f0f0;

                .create-comment {
                    form {
                        display: flex;
                        flex-direction: column;
                        gap: 12px;

                        .comment-input {
                            .el-input {
                                :deep(.el-textarea__inner) {
                                    min-height: 100px;
                                    resize: none;
                                    background-color: #fff;
                                }
                            }
                        }

                        .action-icons {
                            display: flex;
                            align-items: center;
                            width: 100%;
                            justify-content: space-between;
                            padding: 8px 0;

                            .action-list {
                                display: flex;
                                align-items: center;
                                gap: 16px;
                                padding: 4px 0;

                                .mention-icon,
                                .emoji-picker svg {
                                    display: inline-flex;
                                    align-items: center;
                                    vertical-align: middle;
                                    margin-top: -2px; // 微调垂直对齐
                                    cursor: pointer;
                                    color: #666;
                                    transition: color 0.3s;
                                    stroke: 0.3s, fill 0.3s; // 新增描边和填充过
                                    font-size: 16px;

                                    &:hover {
                                        color: #409eff;
                                        stroke: #409eff; // 控制SVG描边颜色 // 控制SVG填充颜色
                                    }
                                }
                            }
                        }
                    }
                }

                .empty-comments {
                    padding: 40px 0;
                    text-align: center;
                    color: #999;
                    background-color: #fff;
                    border-radius: 8px;
                    margin-top: 20px;
                }

                .comment-list {
                    margin-top: 20px;
                    border-bottom: 1px solid #f0f0f0;
                    padding-bottom: 16px;

                    &:last-child {
                        border-bottom: none;
                    }

                    .comment-item {
                        padding: 12px 0;

                        .user-info {
                            display: flex;
                            align-items: center;
                            margin-bottom: 8px;

                            .el-avatar {
                                margin-right: 12px;
                            }

                            .user-meta {
                                display: flex;
                                flex-direction: column;

                                .username {
                                    font-size: 14px;
                                    font-weight: 500;
                                    color: #333;
                                }

                                .comment-time {
                                    font-size: 12px;
                                    color: #999;
                                    margin-top: 2px;
                                }
                            }
                        }

                        .comment-text {
                            font-size: 14px;
                            line-height: 1.6;
                            color: #333;
                            margin-left: 52px; // 与头像对齐
                            margin-bottom: 8px;

                            :deep(.custom-image-wrapper) {
                                margin: 16px 0;
                                padding: 8px;
                                border-radius: 8px;

                                img {
                                    @include img-style(190px);
                                    &:hover {
                                       cursor: pointer;
                                    }
                                }
                            }
                        }

                        .comment-actions {
                            margin-left: 52px;

                            .el-button {
                                padding: 0 8px;
                                color: #666;

                                &:hover {
                                    color: #409eff;
                                }
                            }
                        }

                        .text {
                            margin-left: 52px;
                            color: #666;
                            font-size: 13px;
                            cursor: pointer;
                            display: flex;
                            align-items: center;
                            gap: 4px;
                            margin-top: 8px;

                            &:hover {
                                color: #409eff;
                            }

                            .el-icon {
                                transition: transform 0.3s;
                            }

                            &.expanded .el-icon {
                                transform: rotate(90deg);
                            }
                        }

                        .reply-list {
                            margin-left: 52px;
                            margin-top: 8px;
                            padding: 8px 0;
                            border-top: 1px dashed #f0f0f0;

                            .reply-item {
                                padding: 8px 0;

                                .reply-user {
                                    display: flex;
                                    align-items: center;
                                    gap: 8px;
                                    margin-bottom: 4px;

                                    .username {
                                        font-size: 13px;
                                        color: #409eff;
                                    }
                                }

                                .reply-content {
                                    margin-left: 40px;

                                    p {
                                        font-size: 14px;
                                        color: #333;
                                        line-height: 1.5;
                                        margin-bottom: 4px;
                                    }

                                    .reply-time {
                                        font-size: 12px;
                                        color: #999;
                                    }
                                }
                            }
                        }
                    }
                }

            }
        }
    }



    .postDetail-sidebar {
        width: 280px;
        position: sticky;
        top: 70px;
        height: fit-content;

        .user-card {
            margin-top: 25px;
            background-color: #fff;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            gap: 15px;

            .user-card-info {
                display: flex;


                .user-card-avatar {
                    width: 50px;
                    height: 50px;

                    img {
                        width: 100%;
                        height: 100%;
                        border-radius: 50%;
                        object-fit: cover;
                    }
                }

                .user-info-item {
                    margin-left: 8px;

                    .card-username {
                        font-size: 18px;
                        font-weight: 500;
                        font-weight: bold;
                    }

                    .fans-attention {
                        display: flex;
                        margin-top: 5px;

                        .fans {
                            margin-right: 16px;
                        }

                        .number {
                            margin-left: 8px;
                        }
                    }
                }
            }

            .card-btn {
                margin-top: 10px;
                width: 100%;
                height: 35px;

                .card-button {
                    $c: #00d2d6;
                    width: 100%;
                    height: 100%;
                    color: #fff;
                    background: $c;
                    border: none;

                    &:hover {
                        background: lighten($c, 3);
                    }
                }
            }
        }
    }

    .loading-state,
    .empty-state {
        text-align: center;
        padding: 40px 0;
        color: #666;
        font-size: 16px;
    }
}